<?php

use yii\db\Migration;

/**
 * Handles the creation of table `project_pre_evaluation_value`.
 */
class m171027_074835_create_project_pre_evaluation_value_table extends Migration
{
    /**
     * @inheritdoc
     */
    public function up()
    {//抵押物价值评估
        $this->createTable('project_pre_evaluation_value', [
            'id' => $this->bigPrimaryKey(),
            'mortgage_id' => $this->bigInteger()->notNull(),
            'bank_value' => $this->string()->comment('银行评估价值总价'),
            'third_partner_value' => $this->string()->comment('第三方评估价总价'),
            'third_partner_value_other' => $this->string()->comment('第三方评估价（清算价值）'),
            'auction_price' => $this->string()->comment('司法拍卖单价（元）'),
            'market_conserve_price' => $this->string()->comment('市场保守单价（元/㎡）'),
            'market_radical_price' => $this->string()->comment('市场激进单价（元/㎡）'),
            'market_conservation_total_price' => $this->string()->comment('市场保守总价（元）'),
            'market_radical_total_price' => $this->string()->comment('市场激进总价（元）'),
            'payment_reservation' => $this->string()->comment('抵押物变现价保守（元）'),
            'payment_radical' => $this->string()->comment('抵押物变现价激进（元）'),
            'price_reason' => $this->string()->comment('抵押物定价依据'),
            'created_at' => $this->timestamp(),
            'lock_user' => $this->integer()->comment('上锁用户'),
            'lock_timestamp' => $this->string()->comment('上锁时间'),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('project_pre_evaluation_value');
    }
}
